% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_episodes.R
\name{plot_episodes}
\alias{plot_episodes}
\title{Plot Episodes of Regime Transformation (ERT) over time.}
\usage{
plot_episodes(
  abs = T,
  years = c(1900, 2020),
  country = c(),
  start_incl = 0.01,
  cum_incl = 0.1,
  year_turn = 0.03,
  cum_turn = 0.1,
  tolerance = 5
)
}
\arguments{
\item{abs}{Logical value: if TRUE, the absolute number of countries in an episode for each year is plotted. If FALSE, the share
of countries (in \%) undergoing democratization or autocratization is plotted.}

\item{years}{Vector with numeric values indicating the minimum and maximum year to be plotted.}

\item{country}{Character vector containing the country for which episodes should be shown. Only countries from the
country_name column in the V-Dem data set are accepted. If no countries are specified, global episode numbers
are plotted. Only a single country can be selected.}

\item{start_incl}{What is the minimum annual change on V-Dem's Electoral Democracy Index (EDI) necessary to trigger an episode? 
This is the absolute value of the first difference in the EDI required for the onset 
of either a democratization (+) or autocratization episode (–).}

\item{cum_incl}{What is the minimum amount of total change on the EDI necessary to constitute a manifest episode?
A potential episode might be a period involving any amount of changes over a period following an annual change equal 
to the start inclusion (e.g. 0.01). To identify substantial changes, we set a cumulative inclusion threshold. 
This is the absolute value of the total amount of change needed on the EDI to be considered manifest.}

\item{year_turn}{What is the amount of annual change in the opposite direction to trigger the termination of an episode? 
An episode may end when the case suddenly moves in the opposite direction. 
For example, during an episode of democratization, a country may experience a sudden drop on the EDI. 
This could signal the onset of an autocratization episode. To avoid overlap between episodes, 
we set the absolute value of a change in the opposite direction on the EDI 
as a trigger for the termination of an episode. \emph{Note: Advanced users who wish to remove this criteria altogether 
should set the value of year\_turn equal to cum\_turn. 
Setting this to zero would allow for an episode to terminate when any year of no change is encountered.}}

\item{cum_turn}{What is the amount of gradual change in the opposite direction to trigger the termination of an episode?
An episode may end when the case begins moving in the opposite direction gradually. For example, 
during an episode of democratization, a country may experience a gradual drop on the EDI over a number of years 
that signals democratization has ended. This could also signal the onset of an autocratization episode. 
To avoid overlap between episodes, we set the absolute value of a gradual change in the opposite direction 
on the EDI over the tolerance period (e.g. 5 years) as a trigger for the termination of an episode.}

\item{tolerance}{What is the number of years considered as tolerance for stasis or a gradual movement in the opposite direction?
The tolerance defines the number of years an episode is allowed to remain in stasis 
(i.e. no more movements equal to the start inclusion) and/or move in the opposite direction before it is terminated. 
This parameter also defines the number of years necessary for a case to be considered a democratic breakdown or 
stabilized electoral autocracy. \emph{Therefore, care is necessary when manipulating the default value. 
This could lead to large changes in the composition of episodes. 
We set the default to 5 years because this is the typical amount for an electoral cycle for most countries.}}
}
\value{
The output of this function is a [ggplot2:ggplot()] object with global or country-specific episodes.
}
\description{
`plot_episodes` plots Episodes of Regime Transformation (ERT) over time. It shows either
the global number/share of countries undergoing democratization and autocratization or
episodes for an individual country.
}
\details{
This function is a wrapper for [ggplot2:ggplot()] and produces a plot that shows
democratization and autocratization episodes over time.
Either the global number/share of countries undergoing democratization and autocratization or
episodes for an individual country are plotted. The function calls the [ERT:get_eps()] funtion that is
used to identify episodes.
}
\examples{
\dontrun{
# Plot autocratization and democratization episodes over time using
 default values from [ERT:get_eps()].

 plot_episodes()

# Plot episodes for Belgium between 1910 and 2010.

 plot_episodes(country = c("Belgium"),
               years = c(1910, 2010))
}
}
